package com.greenhouse.config;

import lombok.Data;

@Data
public class Request<T>{
    private Integer status;
    private String message;
    private T data;

    public Request(Integer status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }
    public static <T> Request<T> success(String message, T data) {
        return new Request<>(200, message, data);
    }
    public static <T> Request<T> error(String message, T data) {
        return new Request<>(500, message, data);
    }
    public static <T> Request<T> error() {return Request.error("请先登录",null);}
}
